package com.ddz.interfaces;

import com.ddz.implementation.GameBase;
import com.ddz.interfaces.IInput.TouchEvent;

public abstract class State {
	protected final GameBase game;

    public State(GameBase _game) {
        game = _game;
    }

	// Initialize everything in this state
	public abstract void onInit();

    // Update the screen
    public abstract void onUpdate(float deltaTime);

    // Drawing the screen
    public abstract void onPaint(float deltaTime);

    // When the application pauses
    public abstract void onPause();

    // When the application resumes
    public abstract void onResume();

    // recycle the screen
    public abstract void dispose();
    
	// react to the user pressing the back button
	public abstract void backButton();

	protected boolean inBounds(TouchEvent event, int x, int y, int width,
			int height) {
		if (event.x > x && event.x < x + width - 1 && event.y > y
				&& event.y < y + height - 1)
			return true;
		else
			return false;
	}
}
